package controller

import (
	"GoAdmin/response"
	"fmt"
	"github.com/gin-gonic/gin"
)

func UploadFile(ctx *gin.Context) {
	file, _ := ctx.FormFile("file")
	fmt.Print("文件名称：", file.Filename)

	error := ctx.SaveUploadedFile(file, "file")
	if error != nil {
		response.OnFail(ctx, nil, "文件上传失败")
	}

	response.Success(ctx, nil, "文件上传成功")
}
